<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <?php include "inc/head.php"; ?>
  <style>
  #product-pictrue {
    margin-bottom: 3em;
  }
  </style>
</head>

<body>
  <?php
  include "inc/header.php";
  include "inc/nav.php";
  include "inc/banner.php";
  ?>

  <?php include "inc/breadcrumb.php"; ?>

  <div class="container bg-white block-shadow">
    <div class="row my-2">
      <div class="col-sm-3 hidden-xs">
        <?php include "inc/side.php"; ?>
      </div>

      <div class="col-xs-12 col-sm-9">
        <dl class="title">
          <dt><?php echo $detail['d_name']; ?></dt>
        </dl>
        <div class="article pb-5">
          <?php
          if ($detail['d_ifslideshow']) {
            if (strpos($detail['d_slideshow'], '|') !== false) {
              $pics = explode('|', $detail['d_slideshow']);
            } else {
              $pics = array($detail['d_slideshow']);
            }
          ?>
          <div id="product-pictrue" class="carousel slide" data-ride="carousel">
            <!-- Indicators -->
            <ol class="carousel-indicators">
              <?php
                foreach ($pics as $key => $val) {
                  echo '<li data-target="#product-pictrue" data-slide-to="' . $key . '" class="' . ($key == 0 ? 'active' : '') . '" ></li>';
                }
                ?>
            </ol>

            <!-- Wrapper for slides -->
            <div class="carousel-inner" role="listbox">
              <?php
                foreach ($pics as $key => $val) {
                  echo '<div class="item ' . ($key == 0 ? 'active' : '') . '">
                  <img src="' . $val . '" alt="' . $detail['d_name'] . '" />
                  <div class="carousel-caption hidden">
                    ' . $detail['d_name'] . '
                  </div>
                </div>';
                }
                ?>
            </div>

            <!-- Controls -->
            <a class="left carousel-control" href="#product-pictrue" role="button" data-slide="prev">
              <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
              <span class="sr-only">Previous</span>
            </a>
            <a class="right carousel-control" href="#product-pictrue" role="button" data-slide="next">
              <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
              <span class="sr-only">Next</span>
            </a>
          </div>
          <?php } ?>

          <?php echo $detail['d_content']; ?>

        </div>

        <div class="relation">
          <nav aria-label="...">
            <ul class="pager">
              <?php
              if (!empty($prev)) {
                echo '<li class=""><a href="' . d_url($prev['id'], $prev['d_link']) . '"><span aria-hidden="true">&lsaquo;</span> ' . $prev['d_name'] . '</a></li>';
              }
              if (!empty($next)) {
                echo ' <li class=""><a href="' . d_url($next['id'], $next['d_link']) . '">' . $next['d_name'] . ' <span aria-hidden="true">&rsaquo;</span></a></li>';
              }
              ?>
            </ul>
          </nav>
        </div>
      </div>

    </div>
  </div>

  <div class="clearfix"></div>
  <div class="py-3"></div>

  <?php
  include "inc/footer.php";
  include "inc/js.php";

  include "inc/code.php";
  ?>
</body>

</html>